<?php
$v_record_id = 0;

if(isset($_REQUEST['hdn_record_id'])){
//	$v_record_id = intval($_REQUEST['hdn_record_id']);
	$v_record_id = ($_REQUEST['hdn_record_id']);
}
//Luu trang ngay tiep nhan hien thoi
if(isset($_REQUEST['hdn_received_date_filter'])){
	$v_receive_date_filter = $_REQUEST['hdn_received_date_filter'];
}

//DatCQ bo sung de in bien nhan nhieu ho so
if(isset($_REQUEST['name_staff_receipt'])){
	$name_staff_receipt = $_REQUEST['name_staff_receipt'];
}

if(isset($_REQUEST['address_staff_receipt'])){
	$address_staff_receipt = $_REQUEST['address_staff_receipt'];
}

if(isset($_REQUEST['date_receipt'])){
	$date_receipt = $_REQUEST['date_receipt'];
}

//Bo sung in bien nhan dat dai
if(isset($_REQUEST['hdn_recordtype_filter'])){
	$v_recordtype_filter = $_REQUEST['hdn_recordtype_filter'];
}
//End

#DINHNQ REMMED - DATE: 24/05/07
# Content: In noi dung phieu trinh ky
if(_is_sqlserver()){//CSDL MSSQL 
	// Lay noi dung cua mot ho so
	//----begin----nieuvv----120808--------	
		$v_record_id_list = $_REQUEST['hdn_record_id_list'];
		$arr_record_id = explode(',',$v_record_id_list);
	if($_REQUEST['hdn_record_id_list'] == ''){
		$v_record_id_list = $_REQUEST['hdn_record_id'];
		//$v_record_id_list=$_REQUEST['hdn_record_id'];
	}
	
	$arr_record_id = explode(',',$v_record_id_list);
	//if(sizeof($v_record_id_list) <=1){
		for ($i=0; $i< sizeof($arr_record_id); $i ++)
		{		
			$v_record_id = $arr_record_id[$i];			
			$sql = "Exec Onegate_RecordGetSingle_NieuVV " . $v_record_id ;	
			$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
			$arr_single_record = $ado_conn->GetRow($sql);			
		}
		//Bo sung in bien nhan dat dai
		$sql = "Exec Onegate_RecordProgressLandSelect '".$v_record_id."','".$v_recordtype_filter."'";
		$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
		$arr_single_record_progress_land = $ado_conn->GetRow($sql); 
		//Leav_14082008_begin
			if( $v_recordtype_filter  =='All')
		{
			$v_recordtype_filter = $arr_single_record ['FK_RECORDTYPE'];
		}
		$v_recordtype_id = $_SESSION['onegate_current_recordtype'];		
		$sql_leav = "EXEC Onegate_RecordConflicBy_Fk_Recordtype ";
		$sql_leav=$sql_leav."'".$v_recordtype_id."'";
		$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
		$arr_all_record_conflict = $ado_conn->GetAll($sql_leav);
		if(sizeof($arr_all_record_conflict)>0){
		$list_cmnd="";
			for($i=0;$i<sizeof($arr_all_record_conflict);$i++){
				$v_single_conflict=$arr_all_record_conflict[$i];
				$v_single_conflict_xml=$v_single_conflict['C_RECORD_XML_DATA'];
				$cmnd_i=$v_single_conflict['CMND'];
				if($i==(sizeof($arr_all_record_conflict)-1)){
					$list_cmnd=$list_cmnd.$cmnd_i;
				}else{
					$list_cmnd=$list_cmnd.$cmnd_i.',';
				}
				
				
			}
			//echo 'list_cmnd '.$list_cmnd.'<br/>';
		}
		//Leav_14082008_end		
		// Lay thong tin file anh
	
		session_start();
		$_SESSION['v_record_id_session'] = $v_record_id;
		if($v_record_id > 0){
			$sql = "Exec Onegate_RecordAttachFileGetAll " . $v_record_id ;
			$arr_all_attach_file = _adodb_query_data_in_name_mode($sql);
			$_SESSION['arr_attach'] = $arr_all_attach_file;
		}
	//}
}
?>